package com.qst.liuxu;

import org.junit.Test;

public class TestDeiver01 {

    @Test
    public void test01(){
        System.out.println("结果是："+doSth());
    }

    /**
     * finally 语句在return之前执行
     * 也就是执行完finally部分，才能return回主方法
     * */
    public int doSth(){
        int i = 0;
        int j = 1;
        try {
            return getSum(i++,++j);
        }catch (Exception e){
            return getSum(i++,++j);
        }finally {
            return getSum(i++,++j);
        }
    }

    private int getSum(int i, int j){
        int k = i+ j ;
        return k;
    }
}
